#!/usr/bin/env python
# -*- conding: utf-8 -*-

"""
@Time     : 2024/8/5 23:39
@Author   : liujingmao
@File     : app.py
"""

import dotenv
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from injector import Injector

from config import Config
from internal.router import Router
from internal.server import Http
from .module import ExtensionModule

dotenv.load_dotenv()

conf = Config()

injector = Injector([ExtensionModule])
app = Http(
    __name__,
    conf=conf,
    db=injector.get(SQLAlchemy),
    migrate=injector.get(Migrate),
    router=injector.get(Router)
)

if __name__ == '__main__':
    app.run(debug=True)
